/**
 * @author guojiteng
 */
import request from '@/utils/request'

/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: {
      dictCode
    }
  })
}

/**
 * 闯关列表查询
 * @param {*} data
 */
export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/queryPage',
    method: 'post',
    data
  })
}
/**
 * 创建闯关
 * @param {*} data
 */
export function insert(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/insert',
    method: 'post',
    data
  })
}
/**
 * 编辑闯关
 * @param {*} data
 */
export function update(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/update',
    method: 'post',
    data
  })
}
/**
 * 删除闯关
 * @param {*} id
 */
export function del(id) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/deleteById',
    method: 'get',
    params: { id }
  })
}

/**
 * 获取闯关信息-用于编辑回显
 * @param {*} id
 */
export function get(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/get',
    method: 'post',
    data
  })
}

/**
 * 启用禁用
 */
export function updateStatus(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/updateStatus',
    method: 'post',
    data
  })
}
/**
 * 获取分类树
 */
export function getClassifyTree(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/learnClassify/getClassifyTree',
    method: 'post',
    data
  })
}
/**
 * 闯关记录列表
 */
export function queryRecordPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushLog/queryPage',
    method: 'post',
    data
  })
}
/**
 * 导出成绩---脱敏
 * @param {*} data
 */
export function exportResult(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/exportCertificationRankMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 导出成绩---不脱敏
 * @param {*} data
 */
export function noMaskExportResult(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/rushQuestions/exportCertificationRankNoMask',
    method: 'post',
    responseType: 'blob',
    data
  })
}



